# list

#create
a = []
a.append("a")
print(a)

a_2 = ["b"]
print( a + a_2 )

a += ["c"]
print(a)

print( a * 10)

a *= 10
print(a)

b = ["a"]
b.insert(0,"z")
print(b)

#Retrieve
c = ["a","b","c"]
print(c[0])

v = list(range(1,10))
print(v[1:5])
print(v.index(2))

#Update
c = ["a","b","c"]
c.insert(1,"test")
print(c)

i = ['a_1','a_2','b','c']
i[0:2] = "a"
print(i)

#delete
i = ['a_1','a_2','b','c']
i.pop()
print(i)

a = [1,2,5,3,4,8,7]
a.sort()
print(a)

a = [1,2,5,3,4,8,7]
list(reversed(a))
print(a)

#Tuple

#Create - cannot
#Retrieve
a = (1,2,3)
print(a[0])
print(a.index(1))
print(a[0:1])

#update - cannot
#delete - cannot

#dict

#Create
d = {}
d["a"] = 1
d2 = {"b":2,"c":3}
d.update(d2)
print(d)
print(d.setdefault("a",0))
print(d.setdefault("d",0))

#Retrieve
d = {"a": 1, "b": 2, "c": 3}
print(d["a"])
print(d.get("b"))
print(d.keys())
print(d.values())
print(d.items())

#Update
d = {"a": 1, "b": 2, "c": 3}
d["a"] = 100
print(d)

#delete
d = {"a": 1, "b": 2, "c": 3}
print(d.pop("b"))
print(d.popitem())

#Set

#create
a = set()
a.add("hello")
print(a)

#Retrieve
a = set()
a.add("hello")
print("a" in a)
print("hello" in a)

#update
g = {"hello"}
z = {" world"}
print(g.union(z))

#delete
a = {"a","b","c","d"}
a.remove("a")
print(a)
a.discard("c")
print(a)

x = {"a","b","c","d"}
print(x.pop())